package repository

import (
	"github.com/lab-online/internal/user/entity"
	"github.com/lab-online/internal/user/infra/model"
)

// DeleteUser 软删除指定 `username` 的用户
func (r *Repository) DeleteUser(userEntity entity.UserEntity) error {
	query := model.NewUser(model.WithEntity(userEntity))
	if err := r.db.Delete(query).Error; err != nil {
		return r.errorHandler(err)
	}

	return nil
}
